Repository navigation
Conversation
IntroSelected.companySize is a plain string from the server. Return it only when it is a known CONST.ONBOARDING_COMPANY_SIZE value, current or legacy, instead of casting it at four call sites.
…company size Address review: getCountryCode has one signature that looks the value up in CONST.ALL_COUNTRIES and returns undefined for an unknown value, and normalizeCountryCode is one generic function, so the overloads, IntlStore.get overloads and translateCountry are gone. The chart change is left to Expensify#100148 and the companySize change moved to Expensify#106381. Tests now cover only the changed country behaviour.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
dylanexpensify
left a comment
There was a problem hiding this comment.
Product input not required for this PR.
blimpich
left a comment
There was a problem hiding this comment.
LGTM
– written by Claude on Ben's behalf
|
🚧 blimpich has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.5.37-0 🚀
|
|
No help site update needed — this PR validates saved company-size data without changing normal user workflows or making any existing article instructions incorrect. |
|
@KJ21-ENG Ok to check this off the list?
|
|
@izarutskaya Yes, ok to check off. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.37-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Remove the four
introSelected?.companySize as OnboardingCompanySizecasts.IntroSelected.companySizeis server data stored as a plainstring, so the cast claimed a type that nothing checked.The new
getIntroSelectedCompanySizehelper returns the saved value only when it is one ofCONST.ONBOARDING_COMPANY_SIZE, current or legacy. The invoice-payment onboarding (PayMoneyRequest), workspace creation (buildPolicyData) and guided setup for invited users (getGuidedSetupDataForOpenReport) now use it. Known values are sent exactly as before. An unknown or empty value is no longer sent asonboardingCompanySize.This was split out of #104927 after review, because it needs this runtime check. The code is the same as the
companySizepart of that PR, plus the check.Changed files:
src/libs/actions/Welcome/OnboardingFlow.tssrc/libs/actions/IOU/PayMoneyRequest.tssrc/libs/actions/Policy/Policy.tssrc/libs/actions/Report/index.tstests/unit/OnboardingFlowTest.tsFixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
Unit tests cover this change, as they did when it was part of #104927. No manual case is added, for two reasons:
main.OnboardingFlowTestchecks that current and legacy sizes are kept and that an unknown, empty or missing value gives no company size.PayMoneyRequestTest,PolicyTestandReportTestrun the invoice payment, workspace creation and guided setup paths that use the helper.To repeat the selected suites with the normal repository test command:
npm test -- --runInBand --runTestsByPath \ tests/unit/OnboardingFlowTest.ts \ tests/actions/IOUTest/PayMoneyRequestTest.ts \ tests/actions/PolicyTest.ts \ tests/actions/ReportTest.ts \ tests/actions/IOUTest/TrackExpenseTest.tsOffline tests
N/A. Only the value passed into the existing onboarding data changes. Request queuing and offline behavior are unchanged.
QA Steps
N/A. No user-visible behavior changes for any value the App can create. The unit tests above cover the changed case.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
N/A. No UI or user-visible behavior changes.